package algebra.op;

import entities.concept.AndConcept;
import entities.concept.Concept;
import entities.vocabulary.QueryKeywords;

/**
 * A concept query returns a:C s.t. a is in K;
 * Note: a special C query is \top query, which forms the primary index.
 * @author j55wu
 *
 */
public class CQuery extends Query{
	private Concept c;
	
	public CQuery(Concept c){
		this.c = c;
	}
	
	public Concept getQueryCocnept(){
		return this.c;
	}
	
	public Concept addQueryConcept(Concept d){
		this.c = new AndConcept(this.c, d);
		return this.c;
	}
	
	public Concept changeQueryConcept(Concept d){
		this.c = d;
		return d;
	}

	@Override
	public boolean isPure() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "("+QueryKeywords.QCON+" "+this.c.toString()+")";
	}

	

	
}
